import request from '../utils/request';

export function init() {
  return request({
    url: '/budgetservice/init',
    method: 'post',
  })
}

export function submit(summaryId,exam,confirm) {
  return request({
    url: '/budgetservice/businessDivison/submit',
    method: 'post',
    params: {summaryId,exam,confirm}
  })
}

export function check(companyId) {
  return request({
    url: '/budgetservice/businessDivison/check',
    method: 'post',
    params: {companyId}
  })
}
export function getPayment(summaryId) {
  return request({
    url: '/budgetservice/payment/get',
    method: 'post',
    params: {summaryId}
  })
}

export function deletePayment(id) {
  return request({
    url: '/budgetservice/payment/delete',
    method: 'post',
    params: {id}
  })
}

export function getFunctionList() {
  return request({
    url: '/budgetservice/payment/getFunctionList',
    method: 'post',
  })
}

export function getProjectList() {
  return request({
    url: '/budgetservice/payment/getProjectList',
    method: 'post',
  })
}

export function getDepEconomicsType() {
  return request({
    url: '/budgetservice/depEconomicsType/getAll',
    method: 'post',
  })
}

export function insertPayment(data) {
  return request({
    url: '/budgetservice/payment/insert',
    method: 'post',
    data
  })
}

export function updatePayment(data) {
  return request({
    url: '/budgetservice/payment/update',
    method: 'post',
    data
  })
}

export function getIncome() {
  return request({
    url: '/budgetservice/income/get',
    method: 'post',
  })
}


export function getPaymentByFunction(summaryId) {
  return request({
    url: '/budgetservice/payment/getByFunction',
    method: 'post',
    params: {summaryId}
  })
}


export function getPaymentByProject(summaryId) {
  return request({
    url: '/budgetservice/payment/getByProject',
    method: 'post',
    params: {summaryId}
  })
}

export function getPaymentByGov(summaryId) {
  return request({
    url: '/budgetservice/payment/getByDep',
    method: 'post',
    params: {summaryId}
  })
}

export function getCompany(){
  return request({
    url: '/budgetservice/company/get',
    method: 'post',
  })
}

export function updateCompany(data){
  return request({
    url: '/budgetservice/company/update',
    method: 'post',
    data
  })
}


export function getControl(){
  return request({
    url: '/budgetservice/control/get',
    method: 'post',
  })
}

export function updateControl(data){
  return request({
    url: '/budgetservice/control/update',
    method: 'post',
    data
  })
}

export function getAllCompany(bdId){
  return request({
    url: '/budgetservice/businessDivison/get',
    method: 'post',
    params: {bdId}
  })
}

export function getSummary(companyId){
  return request({
    url: '/budgetservice/businessDivison/getSummary',
    method: 'post',
    params: {companyId}
  })
}
